#include "mysqlconnection.h"
using namespace std;

mysqlconnection::mysqlconnection()
{
    driver = get_driver_instance();
    con = driver->connect("tcp://localhost:3306","root","zhou");
    con->setSchema("mydata");	//connect to the dms database
    //state=con.CreatStatement();
    cout<<"mysql connected"<<endl;
}

sql::Connection * mysqlconnection::getConnection()
{
    return con;
}

mysqlconnection::~mysqlconnection()
{
    //delete pstmt;
    con->close();
    delete con;

}
